package net.xo68.destiny.contract.enums.job;

/**
 * 任务调度类型
 * @author wuxie
 * @version 2020-12-30
 */
public enum JobSchedTypeEnum {
    /**
     * 周期性调度
     */
    PERIODIC((byte)0),
    /**
     * 持续性调度
     */
    PERSISTENT((byte)1);

    private final Byte code;

    JobSchedTypeEnum(Byte code) {
        this.code = code;
    }

    public Byte getCode() {
        return code;
    }


    public static JobSchedTypeEnum of(int code){
        for (JobSchedTypeEnum jobSchedTypeEnum: JobSchedTypeEnum.values()){
            if(code == jobSchedTypeEnum.getCode()){
                return jobSchedTypeEnum;
            }
        }
        return null;
    }
}
